<!-- PicturePreviewPage.html -->
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
		<meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
		<title>图片</title>
		<link rel="stylesheet" href="../../css/CFNetPP_Base.css">
	</head>
	<body>
		<!-- <div class="base_style_color " id='BarAppearance' style="height: 22px;width: 100%"></div>
	    <div class="base_navigation_bar base_style_color base_navigation_item_bar">
        	<a class="base_left_item" href="#" onclick="backClick()"> <img class="base_back_icon" src="../../image/icon_jiantou.png" alt=""> </a>
			<span id="nav_title"></span>
	    </div> -->
	</body>
	<script type="text/javascript" src="../../script/jquery.min.js"></script>
	<script type="text/javascript" src="../../script/api.js"></script>
	<script type="text/javascript">
		apiready = function(){
			setupScreenOrientation();
			setupNotifi();
			setupImage(api.pageParam.imageurl);
			openBackFrame();
		}
		function setupImage(filepath){
			var photoBrowser = api.require('photoBrowser');
			photoBrowser.open({
				images : [filepath],
				bgColor: '#000'
			}, function(ret, err){
				// if (ret.eventType == 'click') {//点击了图片
				// 	backClick();
				// }
			});
		}
		function openBackFrame(){
			api.openFrame({
			    name: 'BackSuspensionWindow',
			    url: '../StudyPlanManage/BackSuspensionWindow.html',
			    rect: {
			        x: 0,
			        y: 20,
			        w: 44,
			        h: 44
			    },
			    pageParam: {
			        closeWinName: 'PicturePreviewPage'
			    },
			    bounces: false
			});
		}
		function setupNotifi(){
			api.addEventListener({
			    name: 'keyback'
			}, function(ret, err) {
			    backClick();
			});
			api.addEventListener({
			    name: 'backFrameGoBackNotifi'
			}, function(ret, err) {
			    api.sendEvent({
				    name: 'imageBackNotifi',
				    extra: api.pageParam
				});
			});
		}
		function setupScreenOrientation(){
			api.setScreenOrientation({orientation:"auto"});
		}
		function backClick(){
			api.sendEvent({
			    name: 'imageBackNotifi',
			    extra: api.pageParam
			});
			api.setScreenOrientation({orientation:"portrait_up"});
			api.closeWin();
		}
	</script>
</html>